import requests
from lxml import etree

start = 0
while True:
    url = f'https://store.ubisoft.com/sea/games?lang=zh_HK&sz=36&format=page-element&start={start}'

    response = requests.get(url)
    # print(response.text)
    tree = etree.HTML(response.text)
    # print(len(tree.xpath('//div[@class="card-details"]')))
    details = tree.xpath('//div[@class="card-details"]')
    for detail in details:
        title = detail.xpath('.//div[@class="prod-title"]/text()')[0]
        type = detail.xpath('.//div[@class="card-subtitle"]/text()')[0]
        price = detail.xpath('.//span[@class="price-sales standard-price"]/text()')[0]
        print(title.strip(), type.strip(), price.strip())
    more = tree.xpath('//button[@class="load-more-button button btn-dblack focus-underline"]')
    if more:
        start += 36
    else:
        break
